/*  1:   */ package nl.siegmann.epublib.viewer;
/*  2:   */ 
/*  3:   */ import java.util.ArrayList;
/*  4:   */ import java.util.List;
/*  5:   */ import javax.swing.text.BadLocationException;
/*  6:   */ import javax.swing.text.MutableAttributeSet;
/*  7:   */ import javax.swing.text.html.HTML.Attribute;
/*  8:   */ import javax.swing.text.html.HTML.Tag;
/*  9:   */ import javax.swing.text.html.HTMLEditorKit.ParserCallback;
/* 10:   */ 
/* 11:   */ class MyParserCallback
/* 12:   */   extends HTMLEditorKit.ParserCallback
/* 13:   */ {
/* 14:   */   private HTMLEditorKit.ParserCallback parserCallback;
/* 15:17 */   private List<String> stylesheetHrefs = new ArrayList();
/* 16:   */   
/* 17:   */   public MyParserCallback(HTMLEditorKit.ParserCallback parserCallback)
/* 18:   */   {
/* 19:20 */     this.parserCallback = parserCallback;
/* 20:   */   }
/* 21:   */   
/* 22:   */   public List<String> getStylesheetHrefs()
/* 23:   */   {
/* 24:24 */     return this.stylesheetHrefs;
/* 25:   */   }
/* 26:   */   
/* 27:   */   public void setStylesheetHrefs(List<String> stylesheetHrefs)
/* 28:   */   {
/* 29:28 */     this.stylesheetHrefs = stylesheetHrefs;
/* 30:   */   }
/* 31:   */   
/* 32:   */   private boolean isStylesheetLink(HTML.Tag tag, MutableAttributeSet attributes)
/* 33:   */   {
/* 34:32 */     return (tag == HTML.Tag.LINK) && (attributes.containsAttribute(HTML.Attribute.REL, "stylesheet")) && (attributes.containsAttribute(HTML.Attribute.TYPE, "text/css"));
/* 35:   */   }
/* 36:   */   
/* 37:   */   private void handleStylesheet(HTML.Tag tag, MutableAttributeSet attributes)
/* 38:   */   {
/* 39:39 */     if (isStylesheetLink(tag, attributes)) {
/* 40:40 */       this.stylesheetHrefs.add(attributes.getAttribute(HTML.Attribute.HREF).toString());
/* 41:   */     }
/* 42:   */   }
/* 43:   */   
/* 44:   */   public int hashCode()
/* 45:   */   {
/* 46:45 */     return this.parserCallback.hashCode();
/* 47:   */   }
/* 48:   */   
/* 49:   */   public boolean equals(Object obj)
/* 50:   */   {
/* 51:49 */     return this.parserCallback.equals(obj);
/* 52:   */   }
/* 53:   */   
/* 54:   */   public String toString()
/* 55:   */   {
/* 56:53 */     return this.parserCallback.toString();
/* 57:   */   }
/* 58:   */   
/* 59:   */   public void flush()
/* 60:   */     throws BadLocationException
/* 61:   */   {
/* 62:57 */     this.parserCallback.flush();
/* 63:   */   }
/* 64:   */   
/* 65:   */   public void handleText(char[] data, int pos)
/* 66:   */   {
/* 67:61 */     this.parserCallback.handleText(data, pos);
/* 68:   */   }
/* 69:   */   
/* 70:   */   public void handleComment(char[] data, int pos)
/* 71:   */   {
/* 72:65 */     this.parserCallback.handleComment(data, pos);
/* 73:   */   }
/* 74:   */   
/* 75:   */   public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos)
/* 76:   */   {
/* 77:69 */     handleStylesheet(t, a);
/* 78:70 */     this.parserCallback.handleStartTag(t, a, pos);
/* 79:   */   }
/* 80:   */   
/* 81:   */   public void handleEndTag(HTML.Tag t, int pos)
/* 82:   */   {
/* 83:74 */     this.parserCallback.handleEndTag(t, pos);
/* 84:   */   }
/* 85:   */   
/* 86:   */   public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos)
/* 87:   */   {
/* 88:78 */     handleStylesheet(t, a);
/* 89:79 */     this.parserCallback.handleSimpleTag(t, a, pos);
/* 90:   */   }
/* 91:   */   
/* 92:   */   public void handleError(String errorMsg, int pos)
/* 93:   */   {
/* 94:83 */     this.parserCallback.handleError(errorMsg, pos);
/* 95:   */   }
/* 96:   */   
/* 97:   */   public void handleEndOfLineString(String eol)
/* 98:   */   {
/* 99:87 */     this.parserCallback.handleEndOfLineString(eol);
/* :0:   */   }
/* :1:   */ }


/* Location:           C:\Users\David\workspace\CosaRaraPorqueSi\main\epublib-tools-3.1.jar
 * Qualified Name:     nl.siegmann.epublib.viewer.MyParserCallback
 * JD-Core Version:    0.7.0.1
 */